1. Field of the Invention
The invention relates to computer processors, and particularly to an operational mode for diagnosing and debugging computer hardware and software.
2. Description of Related Art
A microprocessor is the heart of most modern day computers, providing a centralized location for many functions which are performed by executing a series of instructions. Microprocessors typically include a control unit that monitors and guides the functional units which together execute instructions. Specifically, the control unit monitors and controls the flow of instructions through the stages of processing. The instructions to be executed are generally stored in a computer memory element such as a Read-Only Memory (ROM), a Random Access Memory (RAM). Subject to control of the control unit, a fetching unit fetches each instruction from memory. The instructions are then decoded if necessary, and supplied to an execution unit. The execution unit may include a number of general purpose registers, an arithmetic unit (ALU), control registers, and some control logic. The data stored in the registers, which collectively represents the "processor state," often is modified during operation of the execution unit. At many different stages in the development of a computer product, it may be extremely useful to be able to examine and modify the processor state during operation, or to test the operation of the ALU and the control logic with test data. However, direct access to the execution unit is generally not practical due to factors such as cost and performance, particularly for a mass-produced microprocessor.
In addition to examining and modifying the processor state, it may be useful to examine and modify system memory and input/output (I/O) space. For example, during development of a computer, this capability would be useful to analyze interactions between the many integrated circuits, peripheral components, and the microprocessor. During development of system level software and applications programs that run on that system, the capability to obtain knowledge of the processor state may greatly facilitate debugging efforts.
In designing a computer utilizing a microprocessor, or to debug the many problems that inevitably occur during development of a computer product, an in-circuit emulator (ICE) may be used. An in-circuit emulator is a specially-designed tool that emulates the functions of the microprocessor that it is designed to support, but has additional features built in that greatly facilitate debugging efforts. In operation, an in-circuit emulator is physically placed in the socket on the printed circuit (PC) board in place of the microprocessor. In-circuit emulators implement an alternate memory space that is used to store the processor state and other relevant data for later analysis. In-circuit emulators have disadvantages, including a greater per-unit cost than the mass-produced microprocessor, an inability to detect a problem with the microprocessor itself, a greater labor cost in physically inserting the in-circuit emulator in the socket, and large expense for the associated alternate memory space, connectors, and other equipment.
To test integrated circuits on a printed circuit (PC) board, a circuit tester that may be termed a "bed of nails" has been used. The tester is clamped to the PC board, and for every wire in the package there is a pin on the tester that connects with it. After the tester is connected to each of the wires, test patterns are applied to test the circuits, and the information is stored in an alternate address space. However, with progressively smaller geometries and higher density levels, it becomes impractical to have a pin for every wire in the circuit. Furthermore, at higher speeds of operation, the signals change faster than the ability of the the tester to detect them without disturbing the system's operation. In order to address the problem of testing integrated circuits, an IEEE "boundary scan" standard was developed. In a boundary scan circuit, a simple serial connection snakes through the entire PC board for testing the circuit. Access is provided by a Test Access Port (TAP) that is a part of every chip adhering to the standard.
Problems can occur during development of a program by an applications programmer, or when the program is being integrated with the platform, or later, during execution of a program by a user. For example, the microprocessor may simply stop, it may output meaningless data, or it may destroy data in memory. Locating the cause of such a problem may be extremely difficult. In order to assist the applications programmer in his development efforts, debugging tools have been developed. The debugging tools may be built into the hardware of a computer, or they may include a software-hardware combination.
Sometimes the error is related to the software, and a software debugger may be sufficient to isolate the cause of the error. Software debuggers are assembly code programs that execute at the system level. One debugging technique involves setting breakpoints at some position in the program's code. The breakpoints halt program operation at the next convenient location and shift the program's operation into a debug mode. Because the normal flow of program operation is disrupted by a breakpoint, it is often implemented like an interrupt.
Software debuggers may provide adequate debugging in some instances, however, if the system is not operable, then the debugger program cannot operate. Furthermore, a software debugger is not useful for hardware problems, firmware problems, and timing problems. A software debugger does not operate in real time (i.e., it slows down operating program by inserting additional steps). Thus, a software debugger is not useful for timing dependent problems in which timing synchronization is important. When such a problem is encountered, a full analysis generally requires additional hardware, such as an in-circuit emulator or another hardware debugger.
If a microprocessor of an installed computer system requires troubleshooting or debugging, a service call may be required. The result of a service call is often an unhappy customer, computer downtime, unnecessary expense, and a loss of reputation. It would be an advantage to provide a microprocessor that can be diagnosed from a remote location.
It would be a further advantage to provide a microprocessor with a circuit that, using instructions supplied from an external signal, can probe the processor state, and execute instructions without affecting that state. It would be an additional advantage if the circuit utilizes hardware and pins already on-chip so that the cost of implementing the circuit is low and therefore its inclusion in mass-produced microprocessors supplied to the consumer would be cost-effective. Such a microprocessor would have application for computer designers, manufacturers, systems programmers, application programmers, and service personnel who service the consumer.